const proxy = require('http-proxy-middleware');
module.exports = function(app) {
  console.log(app)
  app.use(proxy('/api', 
    { 
      target: "http://101.132.227.90:10086", 
      changeOrigin:true,
      // pathRewrite: {
      //   "^/api": "/"
      // }
    }));
  app.use(proxy('/product', 
    { 
      target: "http://101.132.227.90:10086/product.php", 
      changeOrigin:true,
      // pathRewrite: {
      //   "^/api": "/"
      // }
    }));
  app.use(proxy('/upload', 
    { 
      target: "http://101.132.227.90:10086/upload/upload.php", 
      changeOrigin:true,
      // pathRewrite: {
      //   "^/api": "/"
      // }
    }));
    app.use(proxy('/section', 
    { 
      target: "http://101.132.227.90:10086/section.php", 
      changeOrigin:true,
      // pathRewrite: {
      //   "^/api": "/"
      // }
    }));
    app.use(proxy('/login', 
    { 
      target: "http://101.132.227.90:10086/login.php", 
      changeOrigin:true,
      // pathRewrite: {
      //   "^/api": "/"
      // }
    }));
    app.use(proxy('/libraries', 
    { 
      target: "http://101.132.227.90:10086/libraries/web/StartCaptchaServlet.php", 
      changeOrigin:true,
    }));
 }